package com.cyzy.controller;

import com.cyzy.domain.dto.ResponseData;
import com.cyzy.domain.query.TLandQuery;
import com.cyzy.domain.vo.TLand;
import com.cyzy.service.MyLandService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class MyLandController {
    @Autowired
    private MyLandService myLandService;
//    搜索
    @PostMapping("/select")
    public ResponseData select(@RequestBody TLandQuery tLandQuery){
        return myLandService.select(tLandQuery);
    }
    //    详细数据
    @PostMapping("/mylandid")
    public ResponseData mylandid(@RequestBody TLandQuery tLandQuery){
        return myLandService.mylandid(tLandQuery);
    }
//    修改服务
    @PostMapping("/myservice")
    public ResponseData myservice(@RequestBody TLand tLand){
        return myLandService.myservice(tLand);
    }
//  浇水
    @PostMapping("/mywatering")
    public ResponseData mywatering(@RequestBody TLand tLand){
        return myLandService.mywatering(tLand);
    }
    //  收获和种植
    @PostMapping("/myplant")
    public ResponseData myplant(@RequestBody TLand tLand){
        return myLandService.myplant(tLand);
    }
}
